package edu.ccut.saturn.studio.wfg.dialog;

import org.eclipse.jface.viewers.ILabelProviderListener;
import org.eclipse.jface.viewers.ITableLabelProvider;
import org.eclipse.swt.graphics.Image;

import edu.ccut.saturn.studio.wfg.model.Shape;

public class ActivitySelectionLabelProvider<T extends Shape> implements ITableLabelProvider {

	@SuppressWarnings("unchecked")
	public Image getColumnImage(Object element, int columnIndex) {
		T t = (T) element;
		if(columnIndex == 0){
			return t.getSmallIcon();
		}
		return null;
	}

	@SuppressWarnings("unchecked")
	public String getColumnText(Object element, int columnIndex) {
		T t = (T) element;
		if (columnIndex == 1){
			return t.getName() + "[" + t.getId() + "]";
		}
		
		return "";
	}

	public void dispose() {
	}
	public boolean isLabelProperty(Object element, String property) {
		return false;
	}
	public void addListener(ILabelProviderListener listener) {
	}
	public void removeListener(ILabelProviderListener listener) {
	}
}
